package nl.maarten.docenthelp.util;

import java.math.BigInteger;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;

public class Util 
{
	public static String MD5(String str)
	{
		String hashword = "";
		try
		{
			MessageDigest md5 = MessageDigest.getInstance("MD5");
			md5.update(str.getBytes());
			BigInteger hash = new BigInteger(1, md5.digest());
			hashword = hash.toString(16);
			
			System.out.println(hashword);
		}
		catch (NoSuchAlgorithmException nsae)
		{
			// ignore
		}
		
		return hashword;
		
	}
}
